#include <iostream>
using namespace std;

int main()
{
    int n = 0;
    cin >> n;
    bool hash[11] = { 0 };
    while (n)
    {
        int tmp = n % 10;
        if (!hash[tmp])
        {
            cout << tmp;
            hash[tmp] = true;
        }
        n /= 10;
    }

    return 0;
}

#include <iostream>
using namespace std;
#include<queue>
typedef long long LL;
int main()
{
    priority_queue<LL, vector<LL>, greater<LL>> heap;
    LL n = 0;
    cin >> n;
    while (n--)
    {
        LL x = 0;
        cin >> x;
        heap.push(x);
    }
    LL ret = 0;
    while (heap.size() > 1)
    {
        LL t1 = heap.top(); heap.pop();
        LL t2 = heap.top(); heap.pop();
        heap.push(t1 + t2);
        ret += t1 + t2;
    }
    cout << ret << endl;
    return 0;
}

#include <iostream>
using namespace std;
const int N = 1e5 + 10;
typedef long long LL;

char s[N];
LL f[N];
LL g[N];
int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> s[i];
    LL ret = 0;
    for (int i = 0; i < n; i++)
    {
        int x = s[i] - 'a';
        ret += f[x];

        f[x] = f[x] + i - g[x];
        g[x] = g[x] + 1;
    }
    cout << ret << endl;
    return 0;
}